var WINDOW_DND_SIZE = 256;
-var WINDOW_CLONE_MAXIMUM_SCALE = 1.0;
+var WINDOW_PREVIEW_MAXIMUM_SCALE = 1.0;
var WINDOW_OVERLAY_IDLE_HIDE_TIMEOUT = 750;
var WINDOW_OVERLAY_FADE_TIME = 200;
return start + (end - start) * step;
}
-var WindowCloneLayout = GObject.registerClass({
+var WindowPreviewLayout = GObject.registerClass({
Properties: {
'bounding-box': GObject.ParamSpec.boxed(
'bounding-box', 'Bounding box', 'Bounding box',
GObject.ParamFlags.READABLE,
Clutter.ActorBox.$gtype),
},
-}, class WindowCloneLayout extends Clutter.LayoutManager {
+}, class WindowPreviewLayout extends Clutter.LayoutManager {
_init() {
super._init();
}
});
-var WindowClone = GObject.registerClass({
+var WindowPreview = GObject.registerClass({
Signals: {
'drag-begin': {},
'drag-cancelled': {},
'show-chrome': {},
'size-changed': {},
},
-}, class WindowClone extends St.Widget {
+}, class WindowPreview extends St.Widget {
_init(realWindow, workspace) {
this.realWindow = realWindow;
this.metaWindow = realWindow.meta_window;
// the initialization of the actor if that layout manager keeps track
// of its container, so set the layout manager after creating the
// container
- this._windowContainer.layout_manager = new WindowCloneLayout();
+ this._windowContainer.layout_manager = new WindowPreviewLayout();
this.add_child(this._windowContainer);
this.set_offscreen_redirect(Clutter.OffscreenRedirect.AUTOMATIC_FOR_OPACITY);
// simply windowScale * layoutScale... almost.
//
// There's one additional constraint: the thumbnail scale must never be
-// larger than WINDOW_CLONE_MAXIMUM_SCALE, which means that the inequality:
+// larger than WINDOW_PREVIEW_MAXIMUM_SCALE, which means that the inequality:
//
-// windowScale * layoutScale <= WINDOW_CLONE_MAXIMUM_SCALE
+// windowScale * layoutScale <= WINDOW_PREVIEW_MAXIMUM_SCALE
//
// must always be true. This is for each individual window -- while we
// could adjust layoutScale to make the largest thumbnail smaller than
-// WINDOW_CLONE_MAXIMUM_SCALE, it would shrink windows which are already
+// WINDOW_PREVIEW_MAXIMUM_SCALE, it would shrink windows which are already
// under the inequality. To solve this, we simply cheat: we simply keep
// each window's "cell" area to be the same, but we shrink the thumbnail
// and center it horizontally, and align it to the bottom vertically.
let verticalScale = spacedHeight / layout.gridHeight;
// Thumbnails should be less than 70% of the original size
- let scale = Math.min(horizontalScale, verticalScale, WINDOW_CLONE_MAXIMUM_SCALE);
+ let scale = Math.min(
+ horizontalScale, verticalScale, WINDOW_PREVIEW_MAXIMUM_SCALE);
let scaledLayoutWidth = layout.gridWidth * scale + hspacing;
let scaledLayoutHeight = layout.gridHeight * scale + vspacing;
let cellWidth = window.boundingBox.width * s;
let cellHeight = window.boundingBox.height * s;
- s = Math.min(s, WINDOW_CLONE_MAXIMUM_SCALE);
+ s = Math.min(s, WINDOW_PREVIEW_MAXIMUM_SCALE);
let cloneWidth = window.boundingBox.width * s;
const cloneHeight = window.boundingBox.height * s;
vfunc_get_focus_chain() {
return this.get_children().filter(c => c.visible).sort((a, b) => {
- if (a instanceof WindowClone && b instanceof WindowClone)
+ if (a instanceof WindowPreview && b instanceof WindowPreview)
return a.slotId - b.slotId;
return 0;
// Create a clone of a (non-desktop) window and add it to the window list
_addWindowClone(win, positioned) {
- let clone = new WindowClone(win, this);
+ let clone = new WindowPreview(win, this);
clone.positioned = positioned;
clone.connect('selected',